clear
clear classes
clear mex
clc




chkH=10;
chkW=10;
totH=100;
totW=100;
col1=[0 0 250];
col2=[100  100 0];



s = dotsTheScreen.theObject;
s.displayRect = [];

dm = dotsTheDrawablesManager.theObject;

% cell contains function handle and color argument
%   textureMakerExample() expects object reference and color argument
%   I'm using a string function name for now because my UDP function
%   doesn't know about function handles yet.  String should be equivalent.

red = [255 0 0];
tx = dm.newObject('dotsDrawableTextures');
tx.textureMakerFevalable = {'textureMakerExample', red};
dm.addDrawableToGroupWithRank(tx, 'sortedGroup', 2);

blue = [0 0 255];
dot = dm.newObject('dotsDrawableTargets');
dot.dotSize = 10;
dot.color = blue;
dm.addDrawableToGroupWithRank(dot, 'sortedGroup', 1);



dm.activeGroup = 'sortedGroup';
dm.openScreenWindow;


tx.width = 1;
tx.height = 1;
dm.mayDrawNextFrame;
WaitSecs(1);

tx.width = 10;
tx.height = 5;
dm.mayDrawNextFrame;
WaitSecs(1);

tx.x = -3;
tx.y = 5;
tx.width = 7;
tx.height = 7;
tx.rotation = 30;
tx.opacity = .5;
tx.falseColor = [64 32 128];
dm.mayDrawNextFrame;
WaitSecs(1);

dm.closeScreenWindow;